<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>article</title>

    </head>
    <body style="overflow-x: hidden;">

        {if $show}
        <div class="row" style="display: inline-block; margin-bottom: 30px;">
            <div class="col-md-12">
                <ol class="breadcrumb" style="background: #FFFFFF; border-bottom: 1px solid #dfdfdf; border-radius: 0;">
                    <li><a href="?c=admin">后台首页</a></li>
                    <li><a href="?c=ad&action=show">文章管理</a></li>
                    <li class="active">所有文章</li>
                </ol>
            </div>
        </div>

        <div class="row">
            <div class="col-md-12">
                <form action="" method="post">
                    <table class="table table-bordered" style="width: 90%; margin: auto;">
                        <tr>
                            <th>文章标题</th>
                            <th>文章类型</th>
                            <th>文章作者</th>
                            <th>文章来源</th>
                            <th>文章内容</th>
                            <th>文章配图</th>
                            <th>创作时间</th>
                            <th>状态</th>
                            <th>操作</th>
                            <th>
                                <label for="allAd">全选 </label>
                                <input type="checkbox" id="allAd">
                            </th>
                        </tr>
                        {foreach $artData as $key=>$value}
                        <tr>
                            <td>{$value['title']|truncate:6}</td>
                            <td>{$adType[$key]}</td>
                            <td>{$artAuthorName[$key]}</td>
                            <td>{$value['source']}</td>
                            <td>{$value['content']|strip_tags:false|truncate:10}</td>
                            <td>
                                {for $i = 0; $i < count($artPic[$key]); $i++}
                                <img src="public/uploads/article/{$artPic[$key][$i]}" style="width: 50px;">
                                {/for}
                            </td>
                            <td>{$value['date']}</td>
                            <td>{$value['state']}</td>
                            <td>
                                <a href="?c=article&action=delete&id={$value['id']}">删除</a>
                            </td>
                            <td>
                                <label for="{$value['id']}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                                <input type="checkbox" id="{$value['id']}" class="choose" name="checked[]" value="{$value['id']}">
                            </td>
                        </tr>
                        {/foreach}
                        <script type="text/javascript">
                            $(document).on('click','#allAd',function () {
                                $(".choose").prop("checked",$(this).prop("checked"));
                            });
                        </script>
                        <tr>
                            <td colspan="9">
                                {$allPage}
                            </td>
                            <td style="vertical-align: middle">
                                <input type="submit" name="delete" value="删除" class="btn btn-danger">
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        {/if}

    </body>
</html>